<?php require_once dirname(realpath(__FILE__)).'./../../config/config.inc.php'; ?>
<!DOCTYPE html>
<html>
	<head>
		<title>Admin of adnet</title>
		<script type="text/javascript" src="/js/jquery-1.5.1.min.js"></script>
		<script>
			$(document).ready(function(){
				$('#btn_add_page').bind('click', function(){
					window.location.href = 'admin.exec.php?action=addpage&name='+$('#page_name').val();
				});

				$('#btn_show_fields_list').bind('click', function(){
					window.location.href = 'admin.exec.php?action=showfieldslist&table='+$('#table_name').val();
				});

				$('#btn_get_france_regions_towns').bind('click', function(){
					window.location.href = 'admin.exec.php?action=getfranceregionstowns';
				});

				$('#btn_import_france_regions_towns').bind('click', function(){
					window.location.href = 'admin.exec.php?action=importfranceregionstowns';
				});

				$('#btn_gen_region_cache').bind('click', function(){
					window.location.href = 'admin.exec.php?action=genregioncache';
				});

				$('#btn_gen_town_cache').bind('click', function(){
					window.location.href = 'admin.exec.php?action=gentowncache';
				});

				$('#btn_import_categories').bind('click', function(){
					window.location.href = 'admin.exec.php?action=importcategories';
				});

				$('#btn_gen_categories_cache').bind('click', function(){
					window.location.href = 'admin.exec.php?action=gencategoriescache';
				});

				$('#btn_gen_regions_towns_cache').bind('click', function(){
					window.location.href = 'admin.exec.php?action=genregionstownscache';
				});
				
			});
		</script>
	</head>
	<body>
		<div id="content">
			<div id="admin_functions_list">
				<div class="admin_function">
					<span>Add page</span>
					<span><input type="text" id="page_name" /></span>
					<span><input type="button" id="btn_add_page" value="Add page" /></span>
				</div>
				
				<div class="admin_function">
					<span>Show the fields list of</span>
					<span><input type="text" id="table_name" /></span>
					<span><input type="button" id="btn_show_fields_list" value="Show field list" /></span>
				</div>
				
				<div class="admin_function">
					<span>Get France's regions and towns</span>
					<span><input type="button" id="btn_get_france_regions_towns" value="Get France's region" /></span>
				</div>
				
				<div class="admin_function">
					<span>Import the France's regions and towns</span>
					<span><input type="button" id="btn_import_france_regions_towns" value="Import france regions+towns" /></span>
				</div>
				
				<div class="admin_function">
					<span>Import the categories</span>
					<span><input type="button" id="btn_import_categories" value="Import categories" /></span>
				</div>
				
				<div class="admin_function">
					<span>Generate the categories cache</span>
					<span><input type="button" id="btn_gen_categories_cache" value="Generate categories cache" /></span>
				</div>
				
				<div class="admin_function">
					<span>Generate the regions and towns cache</span>
					<span><input type="button" id="btn_gen_regions_towns_cache" value="Generate regions towns cache" /></span>
				</div>
			</div>
		</div>
	</body>
</html>